package artid.com.arttogo.bean;

import java.io.Serializable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * 艺术商城-详情使用
 */
public class GoodsInfo extends AppItem implements Serializable {
	String goods_id;
	String goods_name;
	String goods_click;
	String[] goods_image;
	String goods_price;
	String gc_name;
	String goods_size;
	String goods_age;
	String goods_addtime;
	String goods_body;
	String is_auth;
	String institutiontitle;
	String code;
	String realname;
	String artistimg;
	String goods_commend_num;
	String[] commendimage;
	String artist_goods_num;
	String is_artist_follow;
	String artist_id;
	String uid;
	String is_like;
	String goods_storage;
	String store_name;



	@Override
	public void parse(JSONObject obj) {
		if (null == obj) {
			return;
		}
		goods_id = obj.optString("goods_id");
		goods_name = obj.optString("goods_name");
		goods_click = obj.optString("goods_click");

		goods_price = obj.optString("goods_price");
		gc_name = obj.optString("gc_name");
		goods_size = obj.optString("goods_size");
		goods_age = obj.optString("goods_age");
		goods_addtime = obj.optString("goods_addtime");
		goods_body = obj.optString("goods_body");
		is_auth = obj.optString("is_auth");
		institutiontitle = obj.optString("institutiontitle");
		code = obj.optString("code");
		realname = obj.optString("realname");
		artistimg = obj.optString("artistimg");
		goods_commend_num = obj.optString("goods_commend_num");

		artist_goods_num = obj.optString("artist_goods_num");
		is_artist_follow = obj.optString("is_artist_follow");
		artist_id = obj.optString("artist_id");
		uid = obj.optString("uid");
		is_like = obj.optString("is_like");
		goods_storage = obj.optString("goods_storage");
		store_name = obj.optString("store_name");
		JSONArray goodsImgs  = obj.optJSONArray("goods_image");
		String arrstr = "";
		if (goodsImgs==null) {
			return;
		}
		for (int i = 0; i < goodsImgs.length(); i++) {
			try {
				String str =goodsImgs.getString(i);
				arrstr+=(str+",");
			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		goods_image = arrstr.split(",");

		JSONArray commImg =  obj.optJSONArray("commendimage");
		arrstr = "";
		if (commImg==null) {
			return;
		}
		for (int i = 0; i < commImg.length(); i++) {
			try {
				String str =commImg.getString(i);
				arrstr+=(str+",");
			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		commendimage = arrstr.split(",");

	}




	public String getStore_name() {
		return store_name;
	}




	public void setStore_name(String store_name) {
		this.store_name = store_name;
	}




	public String getGoods_id() {
		return goods_id;
	}




	public void setGoods_id(String goods_id) {
		this.goods_id = goods_id;
	}




	public String getGoods_name() {
		return goods_name;
	}




	public void setGoods_name(String goods_name) {
		this.goods_name = goods_name;
	}




	public String getGoods_click() {
		return goods_click;
	}




	public void setGoods_click(String goods_click) {
		this.goods_click = goods_click;
	}




	public String[] getGoods_image() {
		return goods_image;
	}




	public void setGoods_image(String[] goods_image) {
		this.goods_image = goods_image;
	}




	public String getGoods_price() {
		return goods_price;
	}




	public void setGoods_price(String goods_price) {
		this.goods_price = goods_price;
	}




	public String getGc_name() {
		return gc_name;
	}




	public void setGc_name(String gc_name) {
		this.gc_name = gc_name;
	}




	public String getGoods_size() {
		return goods_size;
	}




	public void setGoods_size(String goods_size) {
		this.goods_size = goods_size;
	}




	public String getGoods_age() {
		return goods_age;
	}




	public void setGoods_age(String goods_age) {
		this.goods_age = goods_age;
	}




	public String getGoods_addtime() {
		return goods_addtime;
	}




	public void setGoods_addtime(String goods_addtime) {
		this.goods_addtime = goods_addtime;
	}




	public String getGoods_body() {
		return goods_body;
	}




	public void setGoods_body(String goods_body) {
		this.goods_body = goods_body;
	}




	public String getIs_auth() {
		return is_auth;
	}




	public void setIs_auth(String is_auth) {
		this.is_auth = is_auth;
	}




	public String getInstitutiontitle() {
		return institutiontitle;
	}




	public void setInstitutiontitle(String institutiontitle) {
		this.institutiontitle = institutiontitle;
	}




	public String getCode() {
		return code;
	}




	public void setCode(String code) {
		this.code = code;
	}




	public String getRealname() {
		return realname;
	}




	public void setRealname(String realname) {
		this.realname = realname;
	}




	public String getArtistimg() {
		return artistimg;
	}




	public void setArtistimg(String artistimg) {
		this.artistimg = artistimg;
	}




	public String getGoods_commend_num() {
		return goods_commend_num;
	}




	public void setGoods_commend_num(String goods_commend_num) {
		this.goods_commend_num = goods_commend_num;
	}




	public String[] getCommendimage() {
		return commendimage;
	}




	public void setCommendimage(String[] commendimage) {
		this.commendimage = commendimage;
	}




	public String getArtist_goods_num() {
		return artist_goods_num;
	}




	public void setArtist_goods_num(String artist_goods_num) {
		this.artist_goods_num = artist_goods_num;
	}




	public String getIs_artist_follow() {
		return is_artist_follow;
	}




	public void setIs_artist_follow(String is_artist_follow) {
		this.is_artist_follow = is_artist_follow;
	}




	public String getArtist_id() {
		return artist_id;
	}




	public void setArtist_id(String artist_id) {
		this.artist_id = artist_id;
	}




	public String getUid() {
		return uid;
	}




	public void setUid(String uid) {
		this.uid = uid;
	}




	public String getIs_like() {
		return is_like;
	}




	public void setIs_like(String is_like) {
		this.is_like = is_like;
	}




	public String getGoods_storage() {
		return goods_storage;
	}




	public void setGoods_storage(String goods_storage) {
		this.goods_storage = goods_storage;
	}





}
